network object
This method will disconnect a connected peer immediately.
bool disconnect_peer_forcefully(uint peer_id)
Parameters:
peer_id
The unique ID of the peer to disconnect.
Return value:
true on success, false on failure.
Remarks:
This method will disconnect a peer immediately, without doing any kind of verification with the remote peer. No disconnect event is generated after this call, instead an unreliable disconnection notification is sent out and the peer is then reset immediately. Since the notification is not guaranteed to arrive, it may be that the remote peer times out on its own eventually. Thus, this method should only be used when you do not have the time to wait for the proper disconnection procedure to be performed.
Example:
See the main network chapter.